

$(function(){

	$('.rollover').rolloverImages();


	var PIACORP = {};
	
	PIACORP.SmoothScroll = function () {
		this.selector    = $('a[href^=#], area[href^=#]');
		this.goToPageTop = "#header-area";
		this.speed       = 600;
		this.easing      = "easeOutExpo";
		this.noScrollCName    = "no-scroll";
		if (this.selector.length) {
			this.init();
		}
	}
	
	PIACORP.SmoothScroll.prototype.init = function () {
		var _this = this;
		this.selector.each(function () {
			if (!$(this).hasClass(_this.noScrollCName)) {
				var fi = $(this).attr("href");
				if (fi == "#") return;
				var el = ($(fi).length) ? $(fi) : $("a[name="+fi.replace(/#/,"")+"]");
				if (el.length) {
					$(this).click(function(e) {
						var target = el[0];
						$.scrollTo(target, {
							speed: _this.speed,
							easing: _this.easing,
							onAfter: function() {
								location.hash = "#"+fi.split("#")[1];;
							}
						});
						return false;
					});
				}
			}
		});
	}

	var ss = new PIACORP.SmoothScroll();


});

